package com.kfm.am;

public class StringTest {

    public static void main(String[] args) {
        char ch = 'T';
        String s = "pomelo";
        String str = """
                你好   hello
                world
                "你好"
                """; // 文本块

        System.out.println(str);

        String s1 = "123"; // 字面量
        String s22 = new String(); // "" 与 null 的区别
        String s2 = new String("123"); // 创建对象

        char[] chars = {'今', '天', '天', '气', '不', '错'};
        String s3 = new String(chars);
        String s4 = new String(chars, 2, 3);
        System.out.println(s3);
        System.out.println(s4);

        int[] ints = {97, 65};
        String s5 = new String(ints, 0, 2);
        System.out.println(s5);

//        System.out.println(s1);
//        System.out.println(s2);
    }
}
